<template>
    <div>
<TypeNav></TypeNav>
<ListContainer></ListContainer>
<Recommend></Recommend>
<Rank></Rank>
<Like></Like>
                              <!-- 定义一个自定义属性来给子组件传参，:cname是因为子组件里有多个轮播图，轮播图组件的类名一样就会引起冲突，所以给他传个不一样的名字 -->
<Floor v-for='floor in floorsList' :key='floor.id' :floor='floor' :cname="'floor-swiper'+floor.id" ></Floor>
<Brand></Brand>
    </div>
</template>

<script>
import Floor from './Floor/index.vue'
import ListContainer from './ListContainer/index.vue'
import Rank from './Rank/index.vue'
import Recommend from './Recommend/index.vue'
// import TypeNav from '@/components/TypeNav/index.vue'
import Like from './Like/index.vue'
import Brand from './Brand/index.vue'
import {mapState} from 'vuex'
export default {
name:'Home',
components:{//组件
  Floor,
  ListContainer,
  Rank,
  Recommend,
  // TypeNav,
  Like,
  Brand
},
mounted(){//挂载就获取数据
// console.log('111',floorsList);
  // 获取楼层数据
  this.$store.dispatch('home/getFloorsListData')
},
computed:{//计算属性
//拿到楼层数据
...mapState('home',['floorsList'])
}

}
</script>

<style>

</style>